/*    */ package handling.chat;
/*    */ 
/*    */ import configs.ServerConfig;
/*    */ import handling.ServerType;
/*    */ import handling.netty.ServerConnection;
/*    */ import org.apache.logging.log4j.LogManager;
/*    */ import org.apache.logging.log4j.Logger;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ChatServer
/*    */ {
/* 16 */   private static final Logger log = LogManager.getLogger(ChatServer.class);
/*    */   
/*    */   private static String ip;
/*    */   private static ServerConnection init;
/*    */   private static boolean finishedShutdown = false;
/*    */   private static short port;
/*    */   
/*    */   public static void run_startup_configurations() {
/* 24 */     port = ServerConfig.CHAT_PORT;
/* 25 */     ip = ServerConfig.WORLD_INTERFACE;
/*    */     try {
/* 27 */       init = new ServerConnection(port, -1, -1, ServerType.聊天服务器);
/* 28 */       init.run();
/* 29 */       log.info("聊天服务器绑定端口: " + port + ".");
/* 30 */     } catch (Exception e) {
/* 31 */       throw new RuntimeException("聊天服务器绑定端口 " + port + " 失败", e);
/*    */     } 
/*    */   }
/*    */   
/*    */   public static String getIP() {
/* 36 */     return ip;
/*    */   }
/*    */   
/*    */   public static int getPort() {
/* 40 */     return port;
/*    */   }
/*    */   
/*    */   public static void shutdown() {
/* 44 */     if (finishedShutdown) {
/*    */       return;
/*    */     }
/* 47 */     log.info("正在关闭商城服务器...");
/* 48 */     log.info("商城服务器解除端口绑定...");
/* 49 */     init.close();
/* 50 */     finishedShutdown = true;
/*    */   }
/*    */   
/*    */   public static boolean isShutdown() {
/* 54 */     return finishedShutdown;
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\handling\chat\ChatServer.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */